﻿
using KinectWindows;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace KinectWindowLib
{
    // The basic Nui Event Message
    public class NuiEvent
    {
        public WindowMessages MessageCode { set; get; }
        public long senderId{set;get;}
        public long ReciverId{set;get;}
        public Object[] Args { set; get; }
        public NuiEvent(WindowMessages code, Object[] args)
        {
            MessageCode = code;
            Args = args;
        }
    }
    // The EventEngine     
    public static class NuiEventManager
    {
        private static Queue<NuiEvent> NuiEventBuffer = new Queue<NuiEvent>();
        public static NuiEvent GetEvent()
        {
            if (NuiEventBuffer.Count > 0)
                return NuiEventBuffer.Dequeue();
            return null;
        }
        public static void PostEvent(NuiEvent Nuievent)
        {
            NuiEventBuffer.Enqueue(Nuievent);
        }
    }
}
